<template>
	<view class="page-fade-in" :style="{opacity: pageOpc}">
		<template v-if="pageOpc">
			<view class="content">
				<view class="shop-info-box">
					<view class="info-item flexWrap">
						<view>店铺名称</view>
						<view>{{storeInfo.shop_name}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>地址</view>
						<view>{{storeInfo.location}}</view>
					</view>
					<view class="info-item flexWrap">
						<view>客服电话</view>
						<view>{{storeInfo.franchisee_phone||'未设置'}}</view>
					</view>
					<view class="info-item flexWrap" @tap="goPage('/pages/index/setBusinessTime?business_hours='+storeInfo.business_hours)">
						<view>营业时间</view>
						<view>
							<block v-if="storeInfo.business_hours==24">{{storeInfo.business_hours}}小时营业 </block>
							<block v-else>{{storeInfo.business_hours}}以外</block>
							<text class="icon-more"></text>
						</view>
					</view>
					<view class="info-item flexWrap">
						<view>店铺状态</view>
						<view>
							<block v-if="storeInfo.store_status_data=='business'">营业中</block>
							<block v-else-if="storeInfo.store_status_data=='rest'">休息中</block>
							<block v-else>维护中</block>
						</view>
					</view>
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageOpc:0,
				storeInfo:{}
			}
		},
		onLoad() {
			this.getStoreInfo();
		},
		onReady(){
			setTimeout(() => {
				this.pageOpc=1
			}, 100)
		},
		methods: {
			// 店铺信息
			getStoreInfo(){
				this.$request.post(this.$api.storeInfo, {
					store_id:uni.getStorageSync('store_id')
				}, {
					token:true
				}).then(res => {
					let {
						data = {}
					} = res;
					if (res.code==1) {
						this.storeInfo=data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 0 36upx;
		.shop-info-box{
			border-top: 1upx solid #E3E3E3;
			.info-item{
				font-size: 28upx;
				font-family: PingFang SC;
				font-weight: 400;
				line-height: 40upx;
				color: #6E6E6E;
				padding: 30upx 0;
				border-bottom: 1upx solid #E3E3E3;
				.icon-more{
					border-color: #6E6E6E;
				}
			}
		}
	}
</style>
